<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var sum = parseInt(prompt("请输入0-6之间的数字"));
        if (!isNaN(sum)) {
            if (sum >= 0 && sum < 7) {
                switch (sum) {
                    case 0:
                        document.write("周末");
                        break;
                    case 1:
                        document.write("星期一");
                        break;
                    case 2:
                        document.write("星期二");
                        break;
                    case 3:
                        document.write("星期三");
                        break;
                    case 4:
                        document.write("星期四");
                        break;
                    case 5:
                        document.write("星期五");
                        break;
                    case 6:
                        document.write("周末");
                        break;
                }
            } else {
                alert("请输入0-6之间的数字");
            }
        } else {
            alert("您输入的内容有误");
        }
    </script>
</head>

<body>

</body>

</html>